When using a memory stream in a using statement do I need to call close? For instance is ms.Close() needed here?
using (MemoryStream ms = new MemoryStream(byteArray))
{
// stuff
ms.Close();
}
Home / DeveloperSection / Forums / MemoryStream in Using Statement - Do I need to call close()
When using a memory stream in a using statement do I need to call close? For instance is ms.Close() needed here?
using (MemoryStream ms = new MemoryStream(byteArray))
{
// stuff
ms.Close();
}
Pravesh Singh
03-Feb-2014No, you don't need. It will be called by the .Dispose() method which is automatically called: